package fi.foyt.cs.api.json;

import java.util.Locale;

import org.json.JSONException;
import org.json.JSONObject;

import fi.foyt.cs.persistence.domainmodel.task.TaskRewards;

public class TaskRewardsRenderer implements EntityRenderer<TaskRewards> {

  @Override
  public JSONObject getAsJson(Locale locale, TaskRewards taskRewards) {
    JSONObject jsonObject = new JSONObject();
    
    try {
      
      jsonObject.put("id", taskRewards.getId().getId());
      jsonObject.put("money", taskRewards.getMoney());
      
    } catch (JSONException e1) {
      throw new RenderingException(e1);
    }

    return jsonObject;
  }

}
